/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * TrainingBook
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * TrainingBook is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TrainingBook is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "track-elevation-dialog.hpp"

///@brief Constructor
TrackElevationDialog::TrackElevationDialog(Gtk::Window *parent, Track trace) : Gtk::Dialog("Dénivelé", *parent)
{
	//Set the border width of the window
	set_border_width(0);
	myArea.set_size_request(600,400);
	myArea.SetXList(trace.GetDistanceList());
	myArea.SetXRange(0., trace.Length());
	
	myArea.SetYList(trace.GetElevationList(), 0);
	myArea.SetYRange(trace.MinElevation(), trace.MaxElevation(), 0);
	
	myArea.SetYList(trace.GetSpeedList(), 1);
	myArea.SetYRange(0., trace.MaxSpeed(), 1);

	//Add the drawing area
	get_vbox()->pack_start(myArea, Gtk::PACK_EXPAND_WIDGET);
	
	//Ajout de boutons
	add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
	
	show_all();
}

///@brief Destructor
TrackElevationDialog::~TrackElevationDialog()
{
	
}




